<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>登录</title>
		<style>
			div{
				margin: 5px;
			}		
			#msg｛
			color:red;
			｝
		</style>
		<script>
			function dologin(){
				var msg=document.getElementById("msg");
				var username=document.getElementById("username").value;
				msg.innerHTML="<font color=\"red\">欢迎"+username+"登录</font>"
			}			
			function doclear(){
				document.getElementById('username').value='';
				document.getElementById('password').value='';
			}
		</script>
	</head>
	<body>
		<div id="container">
			<div id="msg"></div>
			<section>
				<fieldset>
					<legend>登录</legend>
					<div>
						<label>用户名:</label>
						<input type="text" name="username" id="username" />
					</div>
					<div>
						<labl> 密码：</labl>
						<input type="password" name="password" id="password" />
					</div>
					<div>
						<button onclick="dologin();">登录</button>
						<button onclick="doclear();">清除</button>
					</div>
				</fieldset>
			</section>
		</div>
	</body>
</html>
